#-*- coding:utf8 -*-
from Crypto.Cipher import AES,DES3
from hashlib import md5

flag=open("flag.txt","rb").read().strip()
paclen=8-len(flag)%8
flag+=paclen*(chr(paclen))

key1="do_you_know_des3"
obj1=DES3.new(key1,DES3.MODE_ECB)
s1=obj1.encrypt(flag)

key2="and_you_know_aes"
iv=md5(key2).digest()
obj2=AES.new(key2,AES.MODE_CBC,iv)
s2=obj2.encrypt(s1)
with open("flag.enc","wb") as f:
	f.write(s2)